home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Top 200 Programs
/
Top 200 Programs.iso
/
Bob8
/
THOMPSON
/
LIBERTY
/
PRODUCT
/
LB14W.EXE
/
CALLDLL2.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-02-01
|
1KB
|
63 lines
'CALLDLL2.BAS Show how to enable/disable controls using API calls
WindowWidth = 472
WindowHeight = 170
enabled = 1
checkbox #main.cbox, "Change me!", [cboxSet], [cboxReset], 22, 26, 344, 20
textbox #main.entry, 22, 81, 344, 25
statictext #main.statictext3, "Enter some text and then click on accept", 22, 56, 320, 20
button #main, "Accept", [accept], UL, 374, 81, 58, 25
open "Experiment!" for dialog as #main
h = hwnd(#main.cbox)
[main.inputLoop] 'wait here for input event
input aVar$
goto [main.inputLoop]
[cboxSet] 'Perform action for the checkbox named 'cbox'
'Insert your own code here
goto [main.inputLoop]
[cboxReset] 'Perform action for the checkbox named 'cbox'
'Insert your own code here
goto [main.inputLoop]
[accept] 'Perform action for the button named 'accept'
print #main.entry, "!contents?"
input #main.entry, text$
open "user" for dll as #user
calldll #user, "SetWindowText", _
h as word, _
text$ as struct, _
result as short
if enabled = 1 then _
enabled = 0 _
else _
enabled = 1
calldll #user, "EnableWindow", _
h as word, _
enabled as ushort, _
result as ushort
close #user
goto [main.inputLoop]